<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>类名操作</title>
	<style>
		.box {
			width: 100px;
			margin: 0 auto;
			background-color: pink;
			font-size: 19px;
			font-family: 隶书;
		}
		.active {
			width: 80px;
			height: 200px;
			background-color: #ff8500;
		}
	</style>
</head>
<body>
	<div class="box">
		123
	</div>
<script>
	const box=document.querySelector('.box')
	box.classList.add('active')
	box.classList.remove('box')
	box.classList.toggle('box')
</script>
</body>
</html>